package com.scau.meetingbook.controller;

import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import com.scau.meetingbook.service.PaymentRecordService;
import com.scau.meetingbook.pojo.PaymentRecord;
import com.scau.meetingbook.vo.ResultVO;

import java.util.List;

@RestController
@RequestMapping("/paymentRecord")
public class PaymentRecordController {

    @Autowired
    private PaymentRecordService paymentRecordService;

    @PostMapping("/insertPaymentRecord")
    public ResultVO insertPaymentRecord(@RequestBody PaymentRecord paymentRecord) throws Exception {
        return paymentRecordService.insertPaymentRecord(paymentRecord);
    }

    @GetMapping("/getPaymentRecordById")
    public ResultVO<PaymentRecord> getPaymentRecordById(Integer id) throws Exception {
        return paymentRecordService.getPaymentRecordById(id);
    }

    @PutMapping("/updatePaymentRecordById")
    public ResultVO updatePaymentRecordById(@RequestBody PaymentRecord paymentRecord) throws Exception {
        return paymentRecordService.updatePaymentRecordById(paymentRecord);
    }

    @DeleteMapping("/deletePaymentRecordById")
    public ResultVO deletePaymentRecordById(Integer id) throws Exception {
        return paymentRecordService.deletePaymentRecordById(id);
    }
}